Visual Basic (Declaration) | |
---|---|
Public Sub DisableEvents() |
Visual Basic (Usage) | Copy Code |
---|---|
|
C# | |
---|---|
public void DisableEvents() |
C++/CLI | |
---|---|
public: void DisableEvents(); |
For an example, refer to Generic RasterCollection.
Calling DisableEvents will increment an internal counter. When the internal counter is 0, ItemAdded or ItemRemoved event will be raised when items are added or removed to/from this Generic RasterCollection.
When the internal counter is not 0, ItemAdded and ItemRemoved events will not be raised. Therefore, for each call to DisableEvents, there should be a corresponding call to EnableEvents in order to restore the raising of events.
Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family